fix(deps): update dependency @apollo/client to v4 #979
+8
−50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.5.0→^3.5.0 || ^4.0.03.12.11→4.1.0Release Notes
apollographql/apollo-client (@apollo/client)
v4.1.0Compare Source
Minor Changes
#13043
65e66caThanks @jerelmiller! - Supportheaderstransport for enhanced client awareness.#12927
785e223Thanks @jerelmiller! - You can now provide a callback function as thecontextoption on themutatefunction returned byuseMutation. The callback function is called with the value of thecontextoption provided to theuseMutationhook. This is useful if you'd like to merge the context object provided to theuseMutationhook with a value provided to themutatefunction.#12923
94ea3e3Thanks @jerelmiller! - Fix an issue where deferred payloads that returned arrays with fewer items than the original cached array would retain items from the cached array. This change includes@streamarrays where stream arrays replace the cached arrays.#12927
96b531fThanks @jerelmiller! - Don't set the fallback value of a@clientfield tonullwhen areadfunction is defined. Instead thereadfunction will be called with anexistingvalue ofundefinedto allow default arguments to be used to set the returned value.When a
readfunction is not defined nor is there a defined resolver for the field, warn and set the value tonullonly in that instance.#12927
45ebb52Thanks @jerelmiller! - Add support forfrom: nullinclient.watchFragmentandcache.watchFragment. Whenfromisnull, the emitted result is:#12926
2b7f2c1Thanks @jerelmiller! - Support the newer incremental delivery format for the@deferdirective implemented in[email protected]. Import theGraphQL17Alpha9Handlerto use the newer incremental delivery format with@defer.#12927
45ebb52Thanks @jerelmiller! - Add support for arrays withuseFragment,useSuspenseFragment, andclient.watchFragment. This allows the ability to use a fragment to watch multiple entities in the cache. Passing an array tofromwill returndataas an array where each array index corresponds to the index in thefromarray.#12927
45ebb52Thanks @jerelmiller! - Add agetCurrentResultfunction to the observable returned byclient.watchFragmentandcache.watchFragmentthat returns the current value for the watched fragment.#13038
109efe7Thanks @jerelmiller! - Add thefromoption toreadFragment,watchFragment, andupdateFragment.#12918
2e224b9Thanks @jerelmiller! - Add support for the@streamdirective on both theDefer20220824Handlerand theGraphQL17Alpha2Handler.#13056
b224efcThanks @jerelmiller! -InMemoryCacheno longer filters out explicitly returnedundefineditems fromreadfunctions for array fields. This now makes it possible to createreadfunctions on array fields that return partial data and trigger a fetch for the full list.#13058
121a2cbThanks @jerelmiller! - Add anextensionsoption tocache.write,cache.writeQuery, andclient.writeQuery. This makesextensionsavailable in cachemergefunctions which can be accessed with the other merge function options.As a result of this change, any
extensionsreturned in GraphQL operations are now available inmergein the cache writes for these operations.#12927
96b531fThanks @jerelmiller! - Add an abstractresolvesClientFieldfunction toApolloCachethat can be used by caches to tellLocalStateif it can resolve a@clientfield when a local resolver is not defined.LocalStatewill emit a warning and set a fallback value ofnullwhen no local resolver is defined andresolvesClientFieldreturnsfalse, or isn't defined. ReturningtruefromresolvesClientFieldsignals that a mechanism in the cache will set the field value. In this case,LocalStatewon't set the field value.#13078
bf1e0dcThanks @phryneas! - Use the default stream merge function for@streamfields only if stream info is present. This change means that using the olderDefer20220824Handlerwill not use the default stream merge function and will instead truncate the streamed array on the first chunk.Patch Changes
#12884
d329790Thanks @phryneas! - Ensure thatPreloadedQueryRefinstances are unsubscribed when garbage collected#13086
1a1d408Thanks @phryneas! - Change the returned value fromnullto{}when all fields in a query were skipped.This also fixes a bug where
useSuspenseQuerywould suspend indefinitely when all fields were skipped.#13010
7627000Thanks @jerelmiller! - Fix an issue where errors parsed from incremental chunks inErrorLinkmight throw when using theGraphQL17Alpha9Handler.#12927
45ebb52Thanks @jerelmiller! - Deduplicate watches created byuseFragment,client.watchFragment, andcache.watchFragmentthat contain the same fragment, variables, and identifier. This should improve performance in situations where auseFragmentor aclient.watchFragmentis used to watch the same object in multiple places of an application.#12927
259ae9bThanks @jerelmiller! - AllowFragmentTypenot only to be called asFragmentType<TData>, but also asFragmentType<TypedDocumentNode>.#12925
5851800Thanks @jerelmiller! - Fix an issue where callingfetchMorewith@deferor@streamwould not rerender incremental results as they were streamed.#12927
9e55188Thanks @jerelmiller! - Truncate@streamarrays only on last chunk by default.#13083
f3c2be1Thanks @phryneas! - Expose theExtensionsWithStreamInfotype forextensionsinCache.writeQuery,Cache.writeandCache.updateso other cache implementations also can correctly access them.#12923
94ea3e3Thanks @jerelmiller! - Improve the cache data loss warning message whenexistingorincomingis an array.#12927
4631175Thanks @jerelmiller! - Ignore top-leveldatavalues on subsequent chunks in incremental responses.#12927
2be8de2Thanks @jerelmiller! - Create mechanism to add experimental features to Apollo Client#12927
96b531fThanks @jerelmiller! - EnsureLocalStatedoesn't try to read from the cache when using ano-cachefetch policy.#12927
bb8ed7bThanks @jerelmiller! - Ensure an error is thrown when@streamis detected and anincrementalDeliveryhandler is not configured.#13053
23ca0baThanks @phryneas! - Use memoized observable mapping when usingwatchFragment,useFragmentoruseSuspenseFragment.#12927
44706a2Thanks @jerelmiller! - Add helper typeQueryRef.ForQuery<TypedDocumentNode>#13082
c257418Thanks @phryneas! - PassstreamInfothrough result extensions as aWeakRef.#12927
4631175Thanks @jerelmiller! - Fix theDefer20220824Handler.SubsequentResulttype to match theFormattedSubsequentIncrementalExecutionResulttype in[email protected].#12927
96b531fThanks @jerelmiller! - Warn when using ano-cachefetch policy without a local resolver defined.no-cachequeries do not read or write to the cache which meantno-cachequeries are silently incomplete when the@clientfield value was handled by a cachereadfunction.#12927
5776ea0Thanks @jerelmiller! - Update theacceptheader used with theGraphQL17Alpha9Handlertomultipart/mixed;incrementalSpec=v0.2to ensure the newest incremental delivery format is requested.#12927
45ebb52Thanks @jerelmiller! -DeepPartial<Array<TData>>now returnsArray<DeepPartial<TData>>instead ofArray<DeepPartial<TData | undefined>>.#13071
99ffe9aThanks @phryneas! -prerenderStatic: Expose return value ofrenderFunctionto userland, fixabortedproperty.This enables usage of
resumeAndPrerenderwith React 19.2.#13026
05eee67Thanks @jerelmiller! - Reduce the number of observables created bywatchFragmentby reusing existing observables as much as possible. This should improve performance when watching the same item in the cache multiple times after a cache update occurs.#13010
7627000Thanks @jerelmiller! - Handle@streampayloads that send multiple items in the same chunk when using theDefer20220824Handler.#13010
7627000Thanks @jerelmiller! - Handle an edge case with theDefer20220824Handlerwhere an error for a@streamitem that bubbles to the@streamboundary (such as an item returningnullfor a non-null array item) would write items from future chunks to the wrong array index. In these cases, the@streamfield is no longer processed and future updates to the field are ignored. This prevents runtime errors that TypeScript would otherwise not be able to catch.#13081
1e06ad7Thanks @jerelmiller! - Avoid callingmergefunctions more than once for the same incremental chunk.v4.0.13Compare Source
Patch Changes
#13094
9cbe2c2Thanks @phryneas! - Ensure thatcompactandmergeOptionspreserve symbol keys.This fixes an issue where the change introduced in 4.0.11 via #13049 would not
be applied if
defaultOptionsforwatchQuerywere declared.Please note that
compactandmergeOptionsare considered internal utilitiesand they might have similar behavior changes in future releases.
Do not use them in your application code - a change like this is not considered
breaking and will not be announced as such.
v4.0.12Compare Source
Patch Changes
f322460Thanks @phryneas! - Fix a potential memory leak where Trie nodes would remain in memory too long.v4.0.11Compare Source
Patch Changes
#13050
8020829Thanks @phryneas! - Replace usage offindLastwith more backwards-compatible methods.#13049
05638deThanks @phryneas! - Fixes an issue where queries starting withskipTokenor lazy queries fromuseLazyQuerywere included inclient.refetchQueries()before they had been executed for the first time. While generally queries with astandbyfetchPolicyshould be included in refetch, these queries never hadvariablespassed in, so they should be excluded until they have run once and received their actual variables.These queries are now properly excluded from refetch operations until after their initial execution.
This change adds a new hidden option to
client.watchQuery,[variablesUnknownSymbol], which may be settruefor queries starting with afetchPolicyofstandby. It will only be applied when creating theObservableQueryinstance and cannot be changed later. This flag indicates that the query's variables are not yet known, and thus it should be excluded from refetch operations until they are.This option is not meant for everyday use and is intended for framework integrations only.
v4.0.10Compare Source
Patch Changes
af4acdcThanks @phryneas! - Fix memory leak #13036v4.0.9Compare Source
Patch Changes
8f3bc9bThanks @jerelmiller! - Fix an issue where switching from options withvariablestoskipTokenwithuseSuspenseQueryanduseBackgroundQuerywould create a newObservableQuery. This could cause unintended refetches wherevariableswere absent in the request when the query was referenced withrefetchQueries.v4.0.8Compare Source
Patch Changes
f6d0efaThanks @CarsonF! - Fix cache.modify() mapping readonly arrays to singular referencev4.0.7Compare Source
Patch Changes
5b4f36aThanks @jerelmiller! - Don't sendoperationTypein the payload sent byGraphQLWsLink.v4.0.6Compare Source
Patch Changes
3b0d89bThanks @phryneas! - Fix a problem withfetchMorewhere the loading state wouldn't reset if the result wouldn't result in a data update.v4.0.5Compare Source
Patch Changes
e2fc385Thanks @phryneas! - Fix an invariance type error in theMockedResponsetype.v4.0.4Compare Source
Patch Changes
#12892
db8a04bThanks @jerelmiller! - Prevent unhandled rejections from the promise returned by calling themutatefunction from theuseMutationhook.#12899
5352c12Thanks @phryneas! - Fix an issue wheninvariantis called by external libraries when no dev error message handler is loaded.#12895
71f2517Thanks @jerelmiller! - SupportskipTokenwithuseQueryto provide a more type-safe way to skip query execution.Note: this change is provided as a patch within the 4.0 minor version because the changes to TypeScript validation with required variables in version 4.0 made using the
skipoption more difficult.#12900
c0d5be7Thanks @phryneas! - Use named exportequalinstead of default from"@​wry/equality"v4.0.3Compare Source
Patch Changes
#12887
6f6ca47Thanks @phryneas! - Fix accidental deep re-export from/reactout of/react/internals#12890
019b422Thanks @jerelmiller! - Ensure thevariablesoption foruseMutationprovides proper IntelliSense suggestions.v4.0.2Compare Source
Patch Changes
56fac52Thanks @phryneas! - restoregetMemoryInternalsaccess in dev buildsv4.0.1Compare Source
Patch Changes
#12876
b00f231Thanks @phryneas! - Fix CJS build output forinvariantErrorCodes#12866
0d1614aThanks @jerelmiller! - ExportisNetworkStatusInFlightfrom@apollo/client/utilities. AddisNetworkStatusSettledto@apollo/client/utilitiesand re-export it from@apollo/clientwith a deprecation.v4.0.0Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.